package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
)

var Es *elasticsearch.Client

func EsInit() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://14.103.243.149:9200",
		},
		// ...
	}

	Es, err = elasticsearch.NewClient(cfg)

	if err != nil {
		panic(err)
	} else {
		fmt.Println("Es创建成功")
	}

}
